package com.alibaba.nacos.example.spring.cloud.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

@Component
@RefreshScope
public class SmsConfig implements InitializingBean {
	/**
	 * 地域内的产品ID
	 */
	@Value("${aliyun_regionId:false}")
	private String aliyun_regionId;
	/**
	 * 阿里云主账号AccessKey AccessKeyId
	 */
	@Value("${aliyun_smsAccount:false}")
	private String aliyun_smsAccount;
	/**
	 * 阿里云主账号AccessKey AccessKeySecret
	 */
	@Value("${aliyun_smsPassword:false}")
	private String aliyun_smsPassword;

	public static String ALIYUN_REGIONID;

	public static String ALIYUN_ACCESS_KEY_ID;

	public static String ALIYUN_ACCESS_KEY_SECRET;

	@Override
	public void afterPropertiesSet() throws Exception {
		ALIYUN_REGIONID = aliyun_regionId;
		ALIYUN_ACCESS_KEY_ID = aliyun_smsAccount;
		ALIYUN_ACCESS_KEY_SECRET = aliyun_smsPassword;
	}
}